import request from '@/utils/request'

export function getTrainList() {
  return request({
    url: '/work/train/list',
    method: 'get',
  })
}

export function getJoinList() {
  return request({
    url: '/work/join/list',
    method: 'get',
  })
}

export function getProjectsByTrain(params) {
  return request({
    url: '/work/train/getProjectsByTrainId',
    method: 'get',
    params:params
  })
}

export function saveOrUpdate(data) {
  return request({
    url: '/work/join/saveOrUpdate',
    method: 'post',
    data:data
  })
}

// 提交报名
export function submitTrain(params) {
  return request({
    url: '/work/join/submitJoin',
    method: 'get',
    params:params
  })
}
// 上传缴费凭证
export function uploadPayPic(file) {
  return request({
    url: '/work/join/uploadPayPic',
    method: 'post',
    headers: {
      "content-type": "multipart/form-data",
    },
    data: file
  })
}

export function deleteTrain(params) {
  return request({
    url: '/work/join/delete-by-id',
    method: 'get',
    params:params
  })
}


// 获取比赛项目列表
export function getJoinProject(params) {
  return request({
    url: '/work/join/'+ params,
    method: 'get',
  })
}